<div class="pageContent">
	
	<form method="post" action="/index.php?act=produce&st=small_class_edit" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
		<div class="pageFormContent" layoutH="58">
			<input type="hidden" name="id" value="{$id}" />

			<p>
				<label>产品小类：</label>
				<input name="produce_name" type="text" size="30" value="{$produce.produce_name}" class="required" errormsg="请输入产品小类名称"/>
			</p>
			<p>
				<label>所属大类：</label>
				<select class="combox" name="parent_id">
					{foreach item=item from=$type}
					<option value="{$item.product_class_id}" {if $produce.parent_id eq $item.product_class_id}selected{/if}>{$item.class_name}</option>
					{/foreach}
				</select>
			</p>
			<div class="divider"></div>
			<div class="unit produce_add">
				<label>产品材质：</label>
				<div><center>
					<table class="list nowrap itemDetail" addButton="添加材质" width="95%">
						<thead>
							<tr>
								<th type="text" name="marerial[]" size="24" fieldClass="required">材质</th>
								<th type="text" name="markup[]" size="24" fieldClass="required">材质加价</th>
								<th type="text" name="show_sort[]" size="24">显示顺序</th>
								<th type="del" width="60">操作</th>
							</tr>
						</thead>
						<tbody>
							{foreach item=item key=key from=$produce.basic_price}
								<tr class="unitBox">
									<td>
										<input type="text" name="marerial[]" value="{$item.marerial}" size="24" class="required textInput valid">
									</td>
									<td>
										<input type="text" name="markup[]" value="{$item.markup}" size="24" class="required textInput">
									</td>
									<td>
										<input type="text" name="show_sort[]" value="{$item.show_sort}" size="24" class="textInput"><br/>
									</td>
									<td>
										<a href="javascript:void(0)" class="btnDel ">删除</a>
									</td>
								</tr>
							{/foreach}
						</tbody>
					</table></center>
				</div>
			</div><br/><br/><br/><br/>
			<div class="divider"></div>
			<p>
				<label>汽运：</label>
				<select class="combox" name="area_motor_id" errormsg="请选择汽运运费模板">
					<option value="0">选择汽运运费模板</option>
					{foreach item=item from=$motor}
					<option value="{$item.transport_tmp_id}" {if $item.transport_tmp_id eq $produce.area_motor_id}selected{/if}>{$item.tmp_name}</option>
					{/foreach}
				</select>
			</p>
			<p>
				<label>水汽联运：</label>
				<select class="combox" name="area_smotor_id"  errormsg="请选择水汽联运运费模板">
					<option value="0">选择水汽联运运费模板</option>
					{foreach item=item from=$smotor}
					<option value="{$item.transport_tmp_id}" {if $item.transport_tmp_id eq $produce.area_smotor_id}selected{/if}>{$item.tmp_name}</option>
					{/foreach}
				</select>
			</p>
			<p>
				<label>水运：</label>
				<select class="combox" name="area_ship_id"  errormsg="请选择水运运费模板">
					<option value="0">选择水运运费模板</option>
					{foreach item=item from=$ship}
					<option value="{$item.transport_tmp_id}" {if $item.transport_tmp_id eq $produce.area_ship_id}selected{/if}>{$item.tmp_name}</option>
					{/foreach}
				</select>
			</p>
			<p>
				<label>火运：</label>
				<select class="combox" name="area_train_id"  errormsg="请选择火运运费模板">
					<option value="0">选择火运运费模板</option>
					{foreach item=item from=$train}
					<option value="{$item.transport_tmp_id}" {if $item.transport_tmp_id eq $produce.area_train_id}selected{/if}>{$item.tmp_name}</option>
					{/foreach}
				</select>
			</p>
			<div class="divider"></div>
			<div class="unit">
				<label>是否有效：</label>
				<label><input type="radio" name="status" value="0" {if $produce.status eq 0}checked{/if}/>有效</label>
				<label><input type="radio" name="status" value="1" {if $produce.status eq 1}checked{/if}/>无效</label>
			</div>

		</div>
		
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>

	</form>

</div>

<script type="text/javascript">
$(function(){
	$(".produce_edit  a.btnAdd").die("click");
	$(".produce_edit  a.btnAdd").live("click",function(){
		var obj = $(this).parents("tr");
		var html = '<br/><input type="text" name="marerial['+obj.index()+'][]" value="" size="24" class="textInput valid">';
		obj.find("td:eq(2)").append(html);
	});
});
</script>